import React, { Component } from 'react'
// import store from '../store'
import { connect } from 'react-redux'
class Brother2 extends Component {


    render() {
        return (
            <div>
                <h2>brother2</h2>
                <h2>仓库中最新值</h2>
                <h3>{this.props.count}</h3>
                <h3>{this.props.name}</h3>

            </div>
        )
    }
}
// state是仓库中的值
const mapStateToProps = state => {
    // 这个返回的对象的值，会作为props传递给Brother2组件
    return {
        count: state.count,
        name: state.user
    }
}
export default connect(mapStateToProps, null)(Brother2)
